#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>

#define __PTHREAD_MUTEX_SIZE__ 56

FILE* outputFile;
pthread_mutex_t lock;
struct _opaque_pthread_mutex_t {long __sig; char __opaque[__PTHREAD_MUTEX_SIZE__]; };


void myBeforeMutexLock(_opaque_pthread_mutex_t *l)
{
	
}

void myAfterMutexLock(_opaque_pthread_mutex_t *l){}

void __attribute__ ((constructor)) Symb_Constructor();

void Symb_Constructor()
{   
   char* configFile = getenv("SYMBTRACE");
   outputFile = fopen(configFile,"w");
   pthread_mutex_init(&lock,NULL);
}

void myBasicBlockEntry(int bbid)
{
	pthread_mutex_lock(&lock);
	fprintf(outputFile,"%lu %d\n",pthread_self(), bbid);
	pthread_mutex_unlock(&lock);
}
